this.name				= "conger_script";
this.author				= "Original script by Kaks (Kestrel&Falcon OXP), mangled here by Thargoid with invaluable advice from Eric Walsh";
this.copyright			= "Creative Commons: attribution, non-commercial, sharealike.";
this.description			= "Conger ship cargo pod actions and reactions";
this.version			= "0.3";

this.subpleas={
	'aquatics_conger_pod_1':'[pod-1-destroyed]','aquatics_conger_pod_2':'[pod-2-destroyed]',
	'aquatics_conger_pod_3':'[pod-3-destroyed]','aquatics_conger_pod_4':'[pod-4-destroyed]'};

	
this.shipSpawned = this.shipWillLaunchFromStation = function(){
	let e = this.ship.subEntities;
	e.items = function(){for (let i = 0; i < this.length; i++) yield this[i];}
	for (let i in e.items()) {
		i.script.plea = this.subpleas[i.primaryRole];
		i.script.owner = this.ship;	//1.70 workaround
		i.script.shipDied = function(whom)
			{
			this.owner.spawn('cargopod', Math.ceil(Math.random()*10));
			if(whom.isPlayer)
				{
				this.owner.commsMessage((expandDescription(this.plea)),5);
				}
			};
	}
}

this.shipDied = function()
	{
	this.ship.spawn('alloy', Math.ceil(Math.random()*6));
	}


